package role_router

import (
	"benkendSystem/api/role_api"
	"benkendSystem/middleware"
	"github.com/gin-gonic/gin"
)

func RoleRouter(r *gin.RouterGroup) {
	role := r.Group("/role").Use(middleware.LoginAuthCheck())
	{
		role.POST("/add", middleware.CheckMenu("addRole"), role_api.AddRole)
		role.POST("/delete", middleware.CheckMenu("deleteRole"), role_api.DeleteRole)
		role.POST("/roleget", middleware.CheckMenu("getRole"), role_api.GetRoleList)
		role.GET("/getdetail", middleware.CheckMenu("getRole"), role_api.GetRoleDetail)
		role.POST("/update", middleware.CheckMenu("updateRole"), role_api.UpdateRole)
		role.POST("/adduser", middleware.CheckMenu("addUserForRole"), role_api.AddRoleForUser)
		role.POST("/getuser", middleware.CheckMenu("getUserFromRole"), role_api.GetUserFromRole)
		role.GET("/getmenufromrole", role_api.GetMenuFromRoleId)
	}
}
